﻿using System;

namespace WebDavProcessor.Constants
{
    public static class WebDavStatusDescriptions
    {
        //Informational
        public const string Continue = "Continue";
        public const string SwitchingProtocols = "Switching Protocols";
        //Successful
        public const string OK = "OK";
        public const string Created = "Created";
        public const string Accepted = "Accepted";
        public const string NonAuthoritativeInformation = "Non-Authoritative Information";
        public const string NoContent = "No Content";
        public const string ResetContent = "Reset Content";
        public const string PartialContent = "Partial Content";
        public const string MultiStatus = "Multi-Status";
        //Redirection
        public const string MultipleChoices = "Multiple Choices";
        public const string MovedPermanently = "Moved Permanently";
        public const string Found = "Found";
        public const string SeeOther = "See Other";
        public const string NotModified = "Not Modified";
        public const string UseProxy = "Use Proxy";
        public const string TemporaryRedirect = "Temporary Redirect";
        //Client Error
        public const string BadRequest = "Bad Request";
        public const string Unauthorized = "Unauthorized";
        public const string PaymentRequired = "Payment Required";
        public const string Forbidden = "Forbidden";
        public const string NotFound = "Not Found";
        public const string MethodNotAllowed = "Method Not Allowed";
        public const string NotAcceptable = "Not Acceptable";
        public const string ProxyAuthenticationRequired = "Proxy Authentication Required";
        public const string RequestTimeout = "Request Timeout";
        public const string Conflict = "Conflict";
        public const string Gone = "Gone";
        public const string LengthRequired = "Length Required";
        public const string PreconditionFailed = "Precondition Failed";
        public const string RequestEntityTooLarge = "Request Entity Too Large";
        public const string RequestUriTooLong = "Request-URI Too Long";
        public const string UnsupportedMediaType = "Unsupported Media Type";
        public const string RequestRangeNotSatisfiable = "Requested Range Not Satisfiable";
        public const string ExpectationFailed = "Expectation Failed";
        public const string UnprocessableEntity = "Unprocessable Entity";
        public const string Locked = "Locked";
        public const string FailedDependency = "Failed Dependency";
        //Server Error
        public const string InternalServerError = "Internal Server Error";
        public const string NotImplemented = "Not Implemented";
        public const string BadGateway = "Bad Gateway";
        public const string ServiceUnavailable = "Service Unavailable";
        public const string GatewayTimeout = "Gateway Timeout";
        public const string HttpVersionNotSupported = "HTTP Version Not Supported";
        public const string InsufficientStorage = "Insufficient Storage";

        //
        public static string GetDescription(int code)
        {
            switch (code)
            {
                //Informational
                case WebDavStatusCodes.Continue: return Continue;
                case WebDavStatusCodes.SwitchingProtocols: return SwitchingProtocols;
                //Successful
                case WebDavStatusCodes.OK: return OK;
                case WebDavStatusCodes.Created: return Created;
                case WebDavStatusCodes.Accepted: return Accepted;
                case WebDavStatusCodes.NonAuthoritativeInformation: return NonAuthoritativeInformation;
                case WebDavStatusCodes.NoContent: return NoContent;
                case WebDavStatusCodes.ResetContent: return ResetContent;
                case WebDavStatusCodes.PartialContent: return PartialContent;
                case WebDavStatusCodes.MultiStatus: return MultiStatus;
                //Redirection
                case WebDavStatusCodes.MultipleChoices: return MultipleChoices;
                case WebDavStatusCodes.MovedPermanently: return MovedPermanently;
                case WebDavStatusCodes.Found: return Found;
                case WebDavStatusCodes.SeeOther: return SeeOther;
                case WebDavStatusCodes.NotModified: return NotModified;
                case WebDavStatusCodes.UseProxy: return UseProxy;
                case WebDavStatusCodes.TemporaryRedirect: return TemporaryRedirect;
                //Client Error
                case WebDavStatusCodes.BadRequest: return BadRequest;
                case WebDavStatusCodes.Unauthorized: return Unauthorized;
                case WebDavStatusCodes.PaymentRequired: return PaymentRequired;
                case WebDavStatusCodes.Forbidden: return Forbidden;
                case WebDavStatusCodes.NotFound: return NotFound;
                case WebDavStatusCodes.MethodNotAllowed: return MethodNotAllowed;
                case WebDavStatusCodes.NotAcceptable: return NotAcceptable;
                case WebDavStatusCodes.ProxyAuthenticationRequired: return ProxyAuthenticationRequired;
                case WebDavStatusCodes.RequestTimeout: return RequestTimeout;
                case WebDavStatusCodes.Conflict: return Conflict;
                case WebDavStatusCodes.Gone: return Gone;
                case WebDavStatusCodes.LengthRequired: return LengthRequired;
                case WebDavStatusCodes.PreconditionFailed: return PreconditionFailed;
                case WebDavStatusCodes.RequestEntityTooLarge: return RequestEntityTooLarge;
                case WebDavStatusCodes.RequestUriTooLong: return RequestUriTooLong;
                case WebDavStatusCodes.UnsupportedMediaType: return UnsupportedMediaType;
                case WebDavStatusCodes.RequestRangeNotSatisfiable: return RequestRangeNotSatisfiable;
                case WebDavStatusCodes.ExpectationFailed: return ExpectationFailed;
                case WebDavStatusCodes.UnprocessableEntity: return UnprocessableEntity;
                case WebDavStatusCodes.Locked: return Locked;
                case WebDavStatusCodes.FailedDependency: return FailedDependency;
                //Server Error
                case WebDavStatusCodes.InternalServerError: return InternalServerError;
                case WebDavStatusCodes.NotImplemented: return NotImplemented;
                case WebDavStatusCodes.BadGateway: return BadGateway;
                case WebDavStatusCodes.ServiceUnavailable: return ServiceUnavailable;
                case WebDavStatusCodes.GatewayTimeout: return GatewayTimeout;
                case WebDavStatusCodes.HttpVersionNotSupported: return HttpVersionNotSupported;
                case WebDavStatusCodes.InsufficientStorage: return InsufficientStorage;
                default: return "(Unused)";
            }
        }
    }
}
